
option(USE_CUSTOME_PLATFORM_TOOLS "使用自定义提供的 Android 平台工具" OFF)
# 采用外部支持的 platform-tools (目前仅 Linux x86_64可用), 在安装时由 debian 安装脚本进行处理
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64" AND USE_CUSTOME_PLATFORM_TOOLS)
    set(PLATFORM_TOOLS /usr/share/${PROJECT_NAME}/lib/platform-tools/)
    set(PLATFORM_TOOLS_ZIP platform-tools_r33.0.3-linux.zip)
    set(UNZIP_PLATFORM_TOOLS_ZIP "unzip ${PLATFORM_TOOLS_ZIP}")

    spark_install_file(/usr/share/${PROJECT_NAME}/lib/
        assets/platform-tools/${PLATFORM_TOOLS_ZIP})
else()
    set(PLATFORM_TOOLS "")
    set(UNZIP_PLATFORM_TOOLS_ZIP "echo 'Do not decompress platform-tools'")
endif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64" AND USE_CUSTOME_PLATFORM_TOOLS)

configure_file(config/config.h.in ${CMAKE_BINARY_DIR}/config.h 
    @ONLY)
configure_file(config/postinst.in ${CMAKE_BINARY_DIR}/config/debian/postinst 
    USE_SOURCE_PERMISSIONS @ONLY)
configure_file(config/postrm.in   ${CMAKE_BINARY_DIR}/config/debian/postrm 
    USE_SOURCE_PERMISSIONS @ONLY)
